package application

import (
	"github.com/gin-gonic/gin"
	"ruoyi/domain/entity/common"
	"ruoyi/domain/entity/response"
	"ruoyi/domain/entity/system"
	"ruoyi/domain/repository"
)

type LogApp struct {
	log repository.SysLoginInfoRepository
}

var _ LogAppInterface = &LogApp{}

type LogAppInterface interface {
	SelectLoginInfoList(params common.SearchTableDataParam) ([]system.SysLoginInfo, int64)

	LoginInfoAdd(context *gin.Context, param system.LoginParam, message string, loginSuccess bool) response.Response

	DelLoginLog(InfoIdS []int) response.Response

	ClearLoginLog() response.Response

	UnlockByUserName(userName string)
}

func (l *LogApp) LoginInfoAdd(context *gin.Context, param system.LoginParam, message string, loginSuccess bool) response.Response {
	return l.log.LoginInfoAdd(context, param, message, loginSuccess)
}

func (l *LogApp) SelectLoginInfoList(params common.SearchTableDataParam) ([]system.SysLoginInfo, int64) {
	return l.log.SelectLoginInfoList(params)
}

func (l *LogApp) DelLoginLog(infoIdS []int) response.Response {
	return l.log.DelLoginLog(infoIdS)
}

func (l *LogApp) ClearLoginLog() response.Response {
	return l.log.ClearLoginLog()
}

func (l *LogApp) UnlockByUserName(userName string) {
	l.log.UnlockByUserName(userName)
}
